﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.Master" CodeBehind="Update.aspx.vb" Inherits="RUHResturants.Update" %>
<%@ Register assembly="GMaps" namespace="Subgurim.Controles" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">

        .style3
        {
            width: 100%;
        }
        .style4
        {
            width: 114px;
        }
        .style9
        {
            width: 77px;
        }
        .style8
        {
            text-align: left;
        }
        .style6
        {
            width: 114px;
            height: 23px;
            text-align: left;
        }
        .style7
        {
            width: 77px;
            height: 23px;
        }
        .style10
        {
            border: 4px solid #000000;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<script  language="javascript"   >

    function AddAddress(Address) {
        var tb = document.getElementById("<%=Addresstxt.ClientID%>");
        if (tb.value.indexOf(Address) >= 0) return;
        else tb.value =  Address ;
    }
</script>

    <table class="style3" align="left" width="300">
    <tr>
        <td class="style4">
                &nbsp;</td>
        <td class="style9" colspan="10">
                <table cellpadding="0" cellspacing="1" class="style10">
                    <tr>
                        <td>
                <cc1:GMap ID="GMap1" runat="server" enableServerEvents="True" OnClick="GMap1_Click" OnMarkerClick="GMap1_MarkerClick"/>
                        </td>
                    </tr>
                </table>
        </td>
    </tr>
    <tr>
        <td class="style8" colspan="11">
            <hr /></td>
    </tr>
    <tr>
        <td class="style8">
    Restaurant Name 
        </td>
        <td class="style9" colspan="10" align=left>
            <asp:TextBox ID="RestNametxt" runat="server"  Width="304px" 
                BorderStyle="Outset"></asp:TextBox>
            <br />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                ControlToValidate="RestNametxt" ErrorMessage="*"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="style6">

            Address
        </td>
        <td class="style7" colspan="10" align=left>
            <asp:TextBox ID="Addresstxt" runat="server" style="margin-left: 0px" 
                Width="200px" BorderStyle="Outset"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="Addresstxt" ErrorMessage="*"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="style8">
    Phone</td>
        <td class="style9" colspan="10" align=left>
            <asp:TextBox ID="Telephonetxt" runat="server" Width="200px" 
                    AutoCompleteType="BusinessPhone" MaxLength="17" 
                    ToolTip="i.e 00966-01-4567890" BorderStyle="Outset"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="Telephonetxt" ErrorMessage="*"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" 
                    ControlToValidate="Telephonetxt" ErrorMessage="Syntax error" 
                    ValidationExpression="^(\d{5}-\d{2}-\d{7})*$"></asp:RegularExpressionValidator>
        </td>
    </tr>
    <tr>
        <td class="style8">
    Email</td>
        <td class="style9" colspan="10" align=left>
            <asp:TextBox ID="Emailtxt" runat="server" Width="200px" BorderStyle="Outset"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ControlToValidate="Emailtxt" ErrorMessage="*"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                    ControlToValidate="Emailtxt" ErrorMessage="Not valid email" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
        </td>
    </tr>
    <tr>
        <td class="style8">
    
    Working hours 
        </td>
        <td class="style9" colspan="10" align=left>
            <asp:TextBox ID="Hourstxt" runat="server" Width="200px" BorderStyle="Outset"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                    ControlToValidate="Hourstxt" ErrorMessage="*"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="style8">
    Price level</td>
        <td class="style9" colspan="10" align=left>
            <asp:DropDownList ID="DropDownList1" runat="server" style="height: 22px">
                <asp:ListItem>Low</asp:ListItem>
                <asp:ListItem>Medium</asp:ListItem>
                <asp:ListItem>High</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td class="style8">
    Luxury level</td>
        <td class="style9" colspan="10" align=left>
            <asp:DropDownList ID="DropDownList2" runat="server">
                <asp:ListItem>Low</asp:ListItem>
                <asp:ListItem>Medium</asp:ListItem>
                <asp:ListItem>High</asp:ListItem>
            </asp:DropDownList>
            <br />
        </td>
    </tr>
    <tr>
        <td class="style8">
    Eating Service</td>
        <td class="style9" colspan="10" align=left>
            <asp:DropDownList ID="DropDownList3" runat="server">
                <asp:ListItem>Take-out</asp:ListItem>
                <asp:ListItem>Sit-down</asp:ListItem>
                <asp:ListItem Value="Sit-down &amp; Take-out">Sit-down &amp; Take-out</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td class="style8">
    
    Facilitats</td>
        <td class="style9" colspan="10" align=left>
            <table class="style3">
                <tr>
                    <td >
                        <asp:CheckBox ID="CheckBox11" runat="server" Text="Internet"/>
                        <asp:CheckBox ID="CheckBox12" runat="server" Text="Parking"/>
                        <asp:CheckBox ID="CheckBox13" runat="server" Text="Delivery"/>
                        <asp:CheckBox ID="CheckBox14" runat="server" Text="Toilet"/>
                        <br />
                        <asp:CheckBox ID="CheckBox15" runat="server" Text="Child Chair"/>
                        <asp:CheckBox ID="CheckBox16" runat="server" Text="TV"/>
                        <asp:CheckBox ID="CheckBox17" runat="server" Text="Music"/>
                        <asp:CheckBox ID="CheckBox18" runat="server" Text="Kids Playing Area"/>
                            </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="style8">
   
    Food Types</td>
        <td class="style9" colspan="10" align=left>
            <asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSourceFood" 
        DataTextField="FoodType" DataValueField="Id" SelectionMode="Multiple" 
        Width="153px" EnableTheming="True"></asp:ListBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                    ControlToValidate="ListBox1" ErrorMessage="*"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="style8" rowspan="2">
                Upload Picture 
        </td>
        <td class="style9" colspan="10" align=left>
            <asp:Label ID="Label2" runat="server" 
                    Text="Note:The system will ignore any image bigger than 845941KB" Width="500px"></asp:Label>
            <br />
            <asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" 
       ErrorMessage="Only jpg & gif " 
       ValidationExpression="^.*\.(jpg|JPG|gif|GIF)$" 
       ControlToValidate="FileUpload1"></asp:RegularExpressionValidator>
            <asp:FileUpload ID="FileUpload1" runat="server" />
            <br />
            <asp:RegularExpressionValidator id="RegularExpressionValidator2" runat="server" 
       ErrorMessage="Only jpg & gif " 
       ValidationExpression="^.*\.(jpg|JPG|gif|GIF)$" 
       ControlToValidate="FileUpload2"></asp:RegularExpressionValidator>
            <asp:FileUpload ID="FileUpload2" runat="server" />
            <br />
            <asp:RegularExpressionValidator id="RegularExpressionValidator3" runat="server" 
       ErrorMessage="Only jpg & gif " 
       ValidationExpression="^.*\.(jpg|JPG|gif|GIF)$" 
       ControlToValidate="FileUpload3"></asp:RegularExpressionValidator>
            <asp:FileUpload ID="FileUpload3" runat="server" />
            <br />
            <asp:RegularExpressionValidator id="RegularExpressionValidator4" runat="server" 
       ErrorMessage="Only jpg & gif " 
       ValidationExpression="^.*\.(jpg|JPG|gif|GIF)$" 
       ControlToValidate="FileUpload4"></asp:RegularExpressionValidator>
            <asp:FileUpload ID="FileUpload4" runat="server" />
            <br />
        </td>
    </tr>
    <tr>
        <td class="style9" colspan="10">
            <asp:DataList ID="DataList2" runat="server" DataSourceID="SqlDataSource1" 
                RepeatDirection="Horizontal" RepeatLayout="Flow">
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" BorderWidth="1px" Height="80" 
                        ImageUrl='<%# Eval("ImgName", "RestImages/{0}") %>' Width="70" />
                </ItemTemplate>
            </asp:DataList>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RUHRestaurantsDB.accdb" 
                    ProviderName="System.Data.OleDb" >
                </asp:SqlDataSource>
        </td>
    </tr>
    <tr>
        <td class="style8">
            &nbsp;</td>
        <td class="style9">
                &nbsp;</td>
        <td class="style9">
            &nbsp;</td>
        <td class="style9">
            &nbsp;</td>
        <td class="style9">
            &nbsp;</td>
        <td class="style9">
            &nbsp;</td>
        <td class="style9">
            &nbsp;</td>
        <td class="style9">
            &nbsp;</td>
        <td class="style9">
            <asp:Button ID="Button4" runat="server" Text="Delete Pictures" Width="100px" />
        </td>
        <td class="style9">
            <asp:Button ID="Button3" runat="server" Text="Cancel" />
        </td>
        <td class="style9">
            <asp:Button ID="Button1" runat="server" Text="Update" />
        </td>
    </tr>
</table>
<br />
<asp:SqlDataSource ID="SqlDataSourceFood" runat="server" 
        ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RUHRestaurantsDB.accdb;Persist Security Info=True" 
        ProviderName="System.Data.OleDb" 
        SelectCommand="SELECT [FoodType], [Id] FROM [FoodTypes]">
</asp:SqlDataSource>
<br />
<br />
</asp:Content>
